<%@ page import = "java.util.Hashtable,
                   ro.xblue.translator.LanguageBean,
                   ro.gateway.aida.servlet.*,
                   ro.gateway.aida.obj.*,
                   ro.xblue.translator.TranslatorUtils,
                   ro.gateway.aida.admin.ActivityObjectsOptions,
                   ro.gateway.aida.admin.ActObjsOptsConst,
                   ro.gateway.aida.utils.Utils,
                   ro.gateway.aida.obj.db.AIDALocationDB,
                   ro.gateway.aida.db.PersistenceToken,
                   ro.gateway.aida.db.PersistenceManager" %>

<%@ taglib uri="/WEB-INF/taglib.tld" prefix="gtw" %>

<%@ taglib uri="/WEB-INF/translator.tld" prefix="trans" %>

<%@ taglib uri="/WEB-INF/usr.tld" prefix="usr" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<%

      Object screen = request.getAttribute(EditActivityServlet.PNAME_SCREEN);

      String key = (String) request.getAttribute(EditActivityServlet.PNAME_KEY);

      if ((request.getAttribute(EditActivityServlet.SIGNATURE) == null) || (key == null)) return;



//      System.err.println("Screen:" + screen);
//
//      System.err.println("Key:" + key);

      Hashtable ed_ctx = (Hashtable) request.getAttribute(EditActivityServlet.PNAME_R_CTX);

      LanguageBean lang_bean = TranslatorUtils.getCurrentLanguage(request, application);

      Activity bean = (Activity) ed_ctx.get(EditActivityServlet.PNAME_BEAN);

      String ctx = request.getContextPath();



      String title = bean.getTitle(lang_bean.language);

      if (title == null) title = "";



      PersonInv[] norole_pers = bean.getPersonsByLRId(OrganizationRole.NO_ROLE);

      if (norole_pers == null) norole_pers = new PersonInv[0];



      AidaResource[] resources = bean.getResources();

      if (resources == null) resources = new AidaResource[0];



      AIDADocument[] documents = bean.getDocuments();

      if (documents == null) documents = new AIDADocument[0];

      String uploaded_file_key = String.valueOf(System.currentTimeMillis());



      ActivityObjectsOptions aoo = ActivityObjectsOptions.getInstance();

      String lang=lang_bean.language;
      PersistenceToken token = PersistenceManager.tokenLookup( application );

      OrganizationInv[] ds_orgs = bean.getOrgsByLRId(OrganizationRole.DATASOURCE_ORG_ROLE);
      if (ds_orgs == null) ds_orgs = new OrganizationInv[0];
%>

<trans:initPage module="prj_pages" />

<gtw:get_errors/>

<html>

<head>
<link rel="shortcut icon" href=<html:rewrite page="/images/lpd.png"/> type="image/ico" />	

 <META HTTP-EQUIV="EXPIRES" CONTENT="0">
 <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<title>Local Projects Database - Project Editor</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" href="alf.css" type="text/css">

<STYLE>.text_searchbold {

	FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #000000; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif

; text-decoration: none}

.text_search {

	FONT-SIZE: 8pt; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none

}

.text {

	FONT-WEIGHT: normal; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none

}

.titlu {

	FONT-WEIGHT: bold; FONT-SIZE: 11pt; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none

}

A:hover {

	TEXT-DECORATION: underline

}

</STYLE>
<script type="text/javascript" src="<html:rewrite page='/javascript/textCounter.js'/>"/></script>
<script language="javascript">
     var ed_oth_pers_win;

     function open_oth_pers() {
        ed_con_pers_win = window.open("pers/selector.do?",
        "ed_oth_win", "HEIGHT=400,WIDTH=500,scrollbars=yes");
     };

     function after_pers_sel() {
          document.theform.after_selector.value = 'pers';
          real_submit();
     };

     function real_submit() {
          document.theform.action.value = '<%=EditActivityServlet.ACTION_SUBMIT%>';
          document.theform.submit();
     };

     var wupload;
     // 1->document, 2->logo
     var upload_what = 1;
     function open_upload_window() {
          var open_arg = "HEIGHT=150,WIDTH=500,SCROLLBARS=YES,LEFT=" +
               (window.screen.availWidth - 500) / 2 + ",TOP=" +
               (window.screen.availHeight - 150) / 2;
          upload_what=1;
          wed_ysubeditor = window.open(
          "misc/upload?bean=<%=uploaded_file_key%>",
          "wupload", open_arg);
     };

     function open_upload_logo_window() {
          var open_arg = "HEIGHT=150,WIDTH=500,SCROLLBARS=YES,LEFT=" +
               (window.screen.availWidth - 500) / 2 + ",TOP=" +
               (window.screen.availHeight - 150) / 2;
          upload_what=2;
          wed_ysubeditor = window.open(
          "misc/upload?bean=<%=uploaded_file_key%>",
          "wupload", open_arg);
     };

	function help(pageName) {
	   ed_donor_orgs_win = window.open(
	   "<%=ctx%>/help/UserGuide.pdf",
	   "ed_fin_win", "HEIGHT=500,WIDTH=700");
	};


     function after_upload(done) {
          if (done == 0) {
               alert("You didn't select a file!");
          } else {
               if (upload_what == 1 ) {
                  document.theform.after_doc_upload.value = 'true';
               } else {
                  document.theform.after_logo_upload.value = 'true';
               }
               document.theform.submit();
          }
     };

     function refresh_() {
          document.theform.after_selector.value='true';
          document.theform.submit();
     }

	var ed_source_orgs_win;
	var whatkindoforgs = 'sourceorgs';
	function open_source_orgs() {
		whatkindoforgs = 'sourceorgs';
		ed_source_orgs_win = window.open(
		"org/selector.do",
		"ed_source_win", "HEIGHT=400,WIDTH=500,scrollbars=yes");
	};
	function after_org_sel() {
		document.theform.after_selector.value = whatkindoforgs;
		real_submit();
	}
</script>
</head>



<body bgcolor="#FFFFFF" text="#000000" topmargin=0 leftmargin=0>

<jsp:include page="header.jsp" /><br><div align=center class=text_bold><trans:showPageMessage label="p.proiect00" /></div><div align=left class=text_search>&nbsp;&nbsp;&nbsp;<trans:showPageMessage label="p.proiect01" /></div><table width="98%" border="0" cellspacing="1" cellpadding="4" class="text_searchBold" background=images/pixelbgtable.gif align="center">

    <tr>

      <td bgcolor="#FFFFFF" class="text_searchBold" width="30%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
               <tr>
                    <td class="text_searchBold" width="10%">
                         <trans:showPageMessage label="p.editor" />
                    </td>
                    <td>
                         <usr:logged_user cellClass="text_search" showLoginLink="false" />
                    </td>
               </tr>
          </table>
      </td>

      <td background=images/pixelbgtable.gif width=35%>

        <div align="center" class="textalb"><trans:showPageMessage label="p.proiect" /></div>

      </td>

      <td bgcolor="#FFFFFF" colspan=2>

        <div align="center"><a href="org/edit" class="text_searchBold"><trans:showPageMessage label="p.organiz" /></a></div>

      </td>
  </tr>

  </table>



  <table width="98%" border="0" cellspacing="1" cellpadding="5" background=images/pixelbgtable.gif align=center>

    <tr bgcolor="#FFFFFF">

      <td align="center" width="75%" class="textalb" background=images/pixelbgtable.gif>

<trans:showPageMessage label="p.page6" />

      </td>

      <td width="25%" class="text_searchBold" background=images/pixelbgtable.gif>&nbsp;



      </td>

    </tr>

<form name="theform" method="post" action="editActivity">

<input type="hidden" name="prj_jump" value="" />
<input type="hidden" name="action" value="<%=EditActivityServlet.ACTION_SUBMIT%>" />

<input type="hidden" name="key" value="<%=key%>" />

<input type="hidden" name="page" value="6" />

<input type="hidden" name="after_selector" value="" />

<input type="hidden" name="preview_data" value="false" />

<input type="hidden" name="addres" value="" />

<input type="hidden" name="delres" value="" />

<input type="hidden" name="adddoc" value="" />

<input type="hidden" name="deldoc" value="" />

<input type="hidden" name="uplkey" value="<%=uploaded_file_key%>" />

<input type="hidden" name="after_doc_upload" value="" />

<input type="hidden" name="after_logo_upload" value="" />

<input type="hidden" name="remuploaded" value="" />

    <tr bgcolor="#FFFFFF">

      <td width="75%" bgcolor="f9f9f9" class="text_search" valign="top">

        <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CNAME)
              ||aoo.isEnabled(ActObjsOptsConst.PROJECT_CTITLE)
              ||aoo.isEnabled(ActObjsOptsConst.PROJECT_CEMAIL)
              ||aoo.isEnabled(ActObjsOptsConst.PROJECT_CCOUNTRY)
              ||aoo.isEnabled(ActObjsOptsConst.PROJECT_CADDR1)
              ||aoo.isEnabled(ActObjsOptsConst.PROJECT_CADDR2)
              ||aoo.isEnabled(ActObjsOptsConst.PROJECT_CPZIP)
              ||aoo.isEnabled(ActObjsOptsConst.PROJECT_CPHONE)
              ||aoo.isEnabled(ActObjsOptsConst.PROJECT_CURL)) { %>
            <br><a name="acontact" /></a>
            <p><img src=images/arrow_blue.gif hspace=4><b><trans:showPageMessage label="p6.labelcont" />
            <br><br>

            <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif align="center">
            <tr bgcolor="#FFFFFF">
                  <td colspan="2" class="text_searchbold"><trans:showPageMessage label="p6.projcinfo" /></td>
            </tr>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CNAME)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.cname" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CNAME) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CNAME%>' /><br/>
                  <input type="text" name="cname"
                  value="<%=bean.getContact().getcName() != null ? bean.getContact().getcName() : ""%>" onkeydown="textCounter(this.form.cname,this.form.ccname,200);" onkeyup="textCounter(this.form.cname,this.form.ccname,200);"/><input readonly type="text" name="ccname" size="3" maxlength="4" value=""> <trans:showPageMessage label="charactersleft" />
                  </td>
            </tr>
            <% } %>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CTITLE)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.ctitle" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CTITLE) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CTITLE%>' /><br/>
                  <input type="text" name="ctitle"
                  value="<%=bean.getContact().getcTitle() != null ? bean.getContact().getcTitle() : ""%>" onkeydown="textCounter(this.form.ctitle,this.form.cctitle,200);" onkeyup="textCounter(this.form.ctitle,this.form.cctitle,200);"/>
				  <input readonly type="text" name="cctitle" size="3" maxlength="4" value=""> <trans:showPageMessage label="charactersleft" />
                  </td>
            </tr>
            <% } %>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CEMAIL)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.cemail" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CEMAIL) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CEMAIL%>' /><br/>
                  <input type="text" name="cemail"
                  value="<%=bean.getContact().getcEmail() != null ? bean.getContact().getcEmail() : ""%>" onkeydown="textCounter(this.form.cemail,this.form.ccemail,200);" onkeyup="textCounter(this.form.cemail,this.form.ccemail,200);"/>
				  <input readonly type="text" name="ccemail" size="3" maxlength="4" value=""> <trans:showPageMessage label="charactersleft" />
                  </td>
            </tr>
            <% } %>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CCOUNTRY)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.ccountry" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CCOUNTRY) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CCOUNTRY%>' /><br/>
                    <select name="ccountry">
                    <%
                              Country[] countries = AIDALocationDB.getManager(token ).getAllCountries();
                    %>
                    <option value=""><trans:showPageMessage label="p6.selcntry" hide_link="true" /></option>
                    <% if (countries != null) for (int i = 0; i < countries.length; i++) { %>
                    <option <%=countries[i].getIso3().equals(bean.getContact().getCountry_iso3()) ? "selected=\"true\"" : "" %> value="<%=countries[i].getIso3()%>"><%=countries[i].getName()%></option>
                    <% } %>
                    </select>
                  </td>
            </tr>
            <% } %>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CADDR1)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.caddr1" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CADDR1) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CADDR1%>' /><br/>
                  <input type="text" name="caddr1"
                  value="<%=bean.getContact().getAddr1() != null ? bean.getContact().getAddr1() : ""%>" onkeydown="textCounter(this.form.caddr1,this.form.ccaddr1,500);" onkeyup="textCounter(this.form.caddr1,this.form.ccaddr1,500);"/>
				  <input readonly type="text" name="ccaddr1" size="3" maxlength="4" value=""> <trans:showPageMessage label="charactersleft" />
                  </td>
            </tr>
            <% } %>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CADDR2)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.caddr2" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CADDR2) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CADDR2%>' /><br/>
                  <input type="text" name="caddr2"
                  value="<%=bean.getContact().getAddr2() != null ? bean.getContact().getAddr2() : ""%>" onkeydown="textCounter(this.form.caddr2,this.form.ccaddr2,500);" onkeyup="textCounter(this.form.caddr2,this.form.ccaddr2,500);"/>
				  <input readonly type="text" name="ccaddr2" size="3" maxlength="4" value=""> <trans:showPageMessage label="charactersleft" />
                  </td>
            </tr>
            <% } %>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CPZIP)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.pzip" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CPZIP) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CPZIP%>' /><br/>
                  <input type="text" name="pzip"
                  value="<%=bean.getContact().getPostalZip() != null ? bean.getContact().getPostalZip() : ""%>" onkeydown="textCounter(this.form.pzip,this.form.cpzip,100);" onkeyup="textCounter(this.form.pzip,this.form.cpzip,100);"/>
				  <input readonly type="text" name="cpzip" size="3" maxlength="4" value=""> <trans:showPageMessage label="charactersleft" />
                  </td>
            </tr>
            <% } %>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CPHONE)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.cphone" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CPHONE) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CPHONE%>' /><br/>
                  <input type="text" name="cphone"
                  value="<%=bean.getContact().getcPhone() != null ? bean.getContact().getcPhone() : ""%>" onkeydown="textCounter(this.form.cphone,this.form.ccphone,100);" onkeyup="textCounter(this.form.cphone,this.form.ccphone,100);"/>
				  <input readonly type="text" name="ccphone" size="3" maxlength="4" value=""> <trans:showPageMessage label="charactersleft" />
                  </td>
            </tr>
            <% } %>
            <% if (aoo.isEnabled(ActObjsOptsConst.PROJECT_CURL)) { %>
            <tr bgcolor="#FFFFFF">
                  <td class="text_searchbold">
                  <trans:showPageMessage label="p6.curl" />
                  <%=aoo.isMandatory(ActObjsOptsConst.PROJECT_CURL) ? "(<font color=red>*</font>)" : ""%>
                  </td>
                  <td class="text_searchbold">
                  <gtw:show_error label='<%=ActObjsOptsConst.PROJECT_CURL%>' /><br/>
                  <input type="text" name="curl"
                  value="<%=bean.getContact().getcURL() != null ? bean.getContact().getcURL() : ""%>" onkeydown="textCounter(this.form.curl,this.form.ccurl,100);" onkeyup="textCounter(this.form.curl,this.form.ccurl,100);"/>
				  <input readonly type="text" name="ccurl" size="3" maxlength="4" value=""> <trans:showPageMessage label="charactersleft" />
                  </td>
            </tr>
            <% } %>
            </table>
        <% } %>


      <% if (aoo.isEnabled(ActObjsOptsConst.OTHER_PERS)) { %>

        <br>

        <a name="adocs" /></a>

      <gtw:show_error label='<%=ActObjsOptsConst.OTHER_PERS%>' />

        <p><img src=images/arrow_blue.gif hspace=4><b><trans:showPageMessage label="p6.labelpers" />

        <%=aoo.isMandatory(ActObjsOptsConst.OTHER_PERS) ? "(<font color=red>*</font>)" : ""%>

        </b> </p>

        <div align="center">

        <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif>

          <tr>

            <td class="text_searchbold" bgcolor="#FFFFFF"><trans:showPageMessage label="p6.listpers" /></td>

        </tr>

        <tr>

            <td class="text_search" bgcolor="#FFFFFF">

            <% if (norole_pers.length == 0) { %>

                  <trans:showPageMessage label="p6.nopers" />

            <% } else { %>

                  <% for (int i = 0; i < norole_pers.length; i++) { %>

                        <input type="checkbox" name="othpers_id" value="<%=norole_pers[i].getPerson_id()%>" />

                        <a href=# onclick="javascript:window.open('pers/view?id=<%=norole_pers[i].getPerson().getId()%>', 'pers_viewer', 'status=yes,WIDTH=400,HEIGHT=400,SCROLLBARS=yes');">

                        <%=norole_pers[i].getPerson().getName()%></a><br>

                  <% } %>

            <% } %>

            </td>

        </tr>

        <tr>

            <td bgcolor="#FFFFFF">

                  <input onClick="javascript:open_oth_pers();" type="button" class="buton" value="<trans:showPageMessage label="p6.edpers" hide_link="true" /> "/>

                  <% if (norole_pers.length > 0) { %>

                  <input type="button" name="remove_oth_pers" class="buton" value="<trans:showPageMessage label="p.remove_oth_pers" hide_link="true" />"

                  onclick="javascript:document.theform.action.value='remove_oth_pers';document.theform.submit();">

                  <% } %>

            </td>

        </tr>

        </table>

        </div>

        <% } // OTHPERS ENABLED  %>



        <% if (aoo.isEnabled(ActObjsOptsConst.DOCUMENTS)) { %>

      <gtw:show_error label='<%=ActObjsOptsConst.DOCUMENTS%>' />

        <p><img src=images/arrow_blue.gif hspace=4><b><trans:showPageMessage label="p6.docs" /></b>

        <%=aoo.isMandatory(ActObjsOptsConst.DOCUMENTS) ? "(<font color=red>*</font>)" : ""%>

        </p>

        <p><trans:showPageMessage label="p6.docinfo" /></p>

        <div align="center">

        <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif>

      <tr bgcolor="#FFFFFF">
      <td colspan="2" class="text_search">
            <trans:showPageMessage label="p6.listdoc" />
      </td>
      </tr>

        <script language="javascript">
            function add_doc() {
              files_win = window.open(
              "<%=ctx%>/activity/edit_files.do?key=<%=key%>&action=create",
              "files_win", "HEIGHT=300,WIDTH=500,scrollbars=YES");
            }
            function edit_docs(forma) {
                  var idxs = '';
                  var first = 1;
                  if (forma.doc_idx.length) {
                        for (var i = 0; i < forma.doc_idx.length; i++) {
                              if (forma.doc_idx[i].checked) {
                                    if (first == 1) {
                                          idxs += forma.doc_idx[i].value;
                                          first = 0;
                                    } else {
                                          idxs += ',' + forma.doc_idx[i].value;
                                    }
                              }
                        }
                        if (first == 1) {
                              alert('Select document and try again');
                              return;
                        }
                  } else {
                        if (!forma.doc_idx.checked) {
                              alert('Select document and try again');
                              return;
                        }
                        idxs = forma.doc_idx.value;
                  }
                  doc_win = window.open(
                  "<%=ctx%>/activity/edit_files.do?key=<%=key%>&action=edit&idxs=" + idxs,
                  "doc_win", "HEIGHT=500,WIDTH=500,SCROLLBARS=1");
            }
        </script>
      <tr bgcolor="#FFFFFF">
      <td colspan="2" class="text_searchbold">
           <trans:showPageMessage label="p6.toaddadocclickhere" />
            <input type="button" value="<trans:showPageMessage label="p6.addadoc" hide_link="true" />"
            name="x1" class="buton"
            onClick="javascript:add_doc();" />
      </td>
      </tr>

        <% if (documents.length == 0) { %>

          <tr bgcolor="#FFFFFF">

           <td colspan="2" class="text_search"><trans:showPageMessage label="p6.no" /></td>

             </tr>

        <% } else { %>
          <% for (int i = 0; i < documents.length; i++) { %>
          <tr bgcolor="#FFFFFF">
            <td width="5%" class="text_search">
                  <input type="checkbox" name="doc_idx" value="<%=i%>" />
            </td>
            <td width="95%" class="text_search">
                  <i><b><%=documents[i].getTitle(lang_bean.language)%></b></i><br>
                  <p style="margin:5px;padding-left:20px;"><%=documents[i].getDesc(lang_bean.language)%></p>
                  <% if (Utils.fileNameLooksLikePic(documents[i].getName())) { %>
                  <img src="<%=ctx%>/dbfile<%=documents[i].getRelativeLink()%>" border="1" width="200" />
                  <% } else {%>
                  <trans:showPageMessage label="p6.link" />:
                  <a target="previewdoc" href="<%=ctx%>/dbfile<%=documents[i].getRelativeLink()%>"><%=documents[i].getName()%></a>
                  <% } %>
            </td>
          </tr>
          <% } %>

            <tr bgcolor="#FFFFFF">
            <td colspan="2" class="text_search"><trans:showPageMessage label="p6.hintdocs" /></td>
            </tr>


            <tr bgcolor="#FFFFFF">
            <td colspan="2" class="text_search">
            <input type="button"
                  class="buton"
                  value="<trans:showPageMessage label="p6.deldoc"
                  hide_link="true"/>"
                  onclick="javascript:document.theform.deldoc.value='true';document.theform.submit();"/>
            <input type="button"
                  class="buton" name="x1"
                  value="<trans:showPageMessage label="p6.editdocs" hide_link="true"/>"
                  onclick="javascript:edit_docs(this.form);"/>
            </td>
            </tr>

        <% } %>

        </table>

        </div>

        <% } // DOCUMENTS ENABLED %>



        <% if (aoo.isEnabled(ActObjsOptsConst.RESOURCES)) { %>

        <br>

        <a name="aresources" /></a>

      <gtw:show_error label='<%=ActObjsOptsConst.RESOURCES%>' />

        <p><b><trans:showPageMessage label="p6.res" /></b>

        <%=aoo.isMandatory(ActObjsOptsConst.RESOURCES) ? "(<font color=red>*</font>)" : ""%>

        </p>

        <div align="center">

        <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif>

        <script language="javascript">
            function add_resource() {
              res_win = window.open(
              "<%=ctx%>/activity/edit_wres.do?key=<%=key%>&action=create",
              "res_win", "HEIGHT=300,WIDTH=500,scrollbars=YES");
            }
        </script>
            <tr bgcolor="#FFFFFF">
            <td colspan="2" class="text_searchbold"><trans:showPageMessage label="p6.listres" /></td>
            </tr>

            <tr bgcolor="#FFFFFF">
            <td colspan="2" class="text_searchbold"> 
            <trans:showPageMessage label="p6.toaddanewres" />:
            <input type="button" value="<trans:showPageMessage label="p6.addawebres" hide_link="true" />"
            name="x1" class="buton"
            onClick="javascript:add_resource();" />
            <br/>
            </td>
            </tr>

            <% if (resources.length == 0) { %>
                  <tr bgcolor="#FFFFFF">
                  <td colspan="2" class="text_search">
                        <trans:showPageMessage label="p6.nores" />
                  </td>
                  </tr>
            <% } else { %>

          <% for (int i = 0; i < resources.length; i++) { %>
            <tr bgcolor="#FFFFFF">
            <td width="5%" class="text_search">
                  <input type="checkbox" name="res_idx" value="<%=i%>" />
                  <a href=<%=resources[i].getLink()%>><%=resources[i].getTitle(lang_bean.language)%></a>
                  <p style="padding-left:20px;margin:5px;"><b><%=resources[i].getDesc(lang_bean.language)%></b></p><br>
            </td>
            </tr>
          <% } %>

            <tr bgcolor="#FFFFFF">
            <td colspan="2" class="text_search"><trans:showPageMessage label="p6.hintres" /></td>
            </tr>


          <script language="javascript">
            function edit_res(forma) {
                  var idxs = '';
                  var first = 1;
                  if (forma.res_idx.length) {
                        for (var i = 0; i < forma.res_idx.length; i++) {
                              if (forma.res_idx[i].checked) {
                                    if (first == 1) {
                                          idxs += forma.res_idx[i].value;
                                          first = 0;
                                    } else {
                                          idxs += ',' + forma.res_idx[i].value;
                                    }
                              }
                        }
                        if (first == 1) {
                              alert('Select webresources and try again');
                              return;
                        }
                  } else {
                        if (!forma.res_idx.checked) {
                              alert('Select webresource and try again');
                              return;
                        }
                        idxs = forma.res_idx.value;
                  }
                  res_win = window.open(
                  "<%=ctx%>/activity/edit_wres.do?key=<%=key%>&action=edit&idxs=" + idxs,
                  "res_win", "HEIGHT=500,WIDTH=500,SCROLLBARS=1");
            }
          </script>

          <tr bgcolor="#FFFFFF">

            <td colspan="2" class="text_search">

              <input type="button"

                 class="buton" name="x2"

                 value="<trans:showPageMessage label="p6.delres" hide_link="true"/>"

                 onclick="javascript:document.theform.delres.value='true';document.theform.submit();"/>
              <input type="button"

                 class="buton" name="x1"

                 value="<trans:showPageMessage label="p6.editres" hide_link="true"/>"

                 onclick="javascript:edit_res(this.form);"/>

                 </td>

             </tr>

        <% } %>
        </table>

        </div>

        <% } // RESOURCES ENABLED %>



        <% if (aoo.isEnabled(ActObjsOptsConst.LOGO)) { %>

        <br>

        <a name="alogo" /></a>

      <gtw:show_error label='<%=ActObjsOptsConst.LOGO%>' />

        <p><b><trans:showPageMessage label="p6.logo" /></b>

        <%=aoo.isMandatory(ActObjsOptsConst.LOGO) ? "(<font color=red>*</font>)" : ""%>

        </p>

        <div align="center">

        <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif>



            <% if (bean.getLogo_url() != null) { %>

            <tr bgcolor="#FFFFFF">

            <td colspan="2" class="text_searchbold">

                  <img src="<%=ctx%>/dbfile<%=bean.getLogo_url()%>" border="1" />

            </td>

            </tr>

            <% } %>



            <tr bgcolor="#FFFFFF">

            <td colspan="2" class="text_searchbold"><trans:showPageMessage label="p6.logo" /></td>

            </tr>

            <tr bgcolor="#FFFFFF">

            <td colspan="2" class="text_searchbold">

            <input type="button" class="buton" value="<trans:showPageMessage label="p6.upload" hide_link="true"/>"

            onclick="javascript:open_upload_logo_window();"

            />

            </td>

            </tr>

        </table>

        <% } %>

		<P/>
        <div align="center">
        <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif>
            <tr bgcolor="#FFFFFF">
            <td valign="top" class="text_searchbold" align="right">
                  Information source:
            </td>
            <td class="text_searchbold">
		  	<textarea cols="30" rows="3" onkeydown="javascript:textCounter(this.form.infosource,this.form.cinfosource,512);"
	onkeyup="javascript:textCounter(this.form.infosource,this.form.cinfosource,512);"
				name="infosource"><%=bean.getInfoSource() != null ? bean.getInfoSource() : ""%></textarea>
			<br/><input readonly type="text"
				name="cinfosource" size="3" maxlength="4" value="<%=512-(bean.getInfoSource() != null ? bean.getInfoSource().length() : 0)%>">
			<trans:showPageMessage label="charactersleft" />
            </td>
            </tr>
        </table>


        <br><br>
      <% if(aoo.isEnabled(ActObjsOptsConst.DATASOURCEINSTITUTIONS)) { %>
      <gtw:show_error label='<%=ActObjsOptsConst.DATASOURCEINSTITUTIONS%>' />
        <br>
        <p><img src=images/arrow_blue.gif hspace=4><b><trans:showPageMessage label="p.sourceinst" />
        <%=aoo.isMandatory(ActObjsOptsConst.DATASOURCEINSTITUTIONS) ? "(<font color=red>*</font>)" : ""%>
        </b> </p>
        <div align="center">
        <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif>
          <tr>
            <td class="text_searchbold" bgcolor="#FFFFFF"><trans:showPageMessage label="p5.listdsinst" /></td>
        </tr>
        <tr>
            <td class="text_search" bgcolor="#FFFFFF">
              <% if (ds_orgs.length == 0) { %>
              <trans:showPageMessage label="p5.nods_inst" />
              <% } else { %>
              <% for (int i = 0; i < ds_orgs.length; i++) { %>
                  <input type="checkbox" name="sourceorg_id" value="<%=ds_orgs[i].getOrg_id()%>" />
                  <a href=# onclick="javascript:window.open('org/view?id=<%=ds_orgs[i].getOrg().getId()%>', 'org_viewer', 'status=yes,WIDTH=400,HEIGHT=400,scrollbars=YES');">
                  <%=ds_orgs[i].getOrg().getName()%></a><br>
                <% } %>
            <% } %>
            </td>
        </tr>
        <tr>
            <td bgcolor="#FFFFFF">
                  <input onClick="javascript:open_source_orgs();" class="buton" type="button" value="<trans:showPageMessage label="p5.edsource" hide_link="true" />" />
                  <% if (ds_orgs.length > 0) { %>
                        <input type="button" name="remove_source_orgs" class="buton" value="<trans:showPageMessage label="p.remove_source_orgss" hide_link="true" />"
                        onclick="javascript:document.theform.action.value='remove_source_orgs';document.theform.submit();">
                  <% } %>
			<trans:showPageMessage label="translator.showhiddentags"/>
            </td>
        </tr>
        </table>
        </div>
      <% } %>

        <div align="center">

        <input type="button" name="un_nume" value="<trans:showPageMessage label="p.sinfo" hide_link="true"/>"

        onClick="javascript:document.theform.action.value='<%=EditActivityServlet.ACTION_SUBMIT%>';document.theform.submit();"

        class="butonsave"/>

        </div>



      </td>

      <td width="25%" valign="top">

<!-- meniu dreapta -->

      <table width="98%" border="0" cellspacing="1" cellpadding="2" bgcolor="#000066">

        <tr>

	      <td align="center"><b> <span class="textalb"><trans:showPageMessage label="p.proj" />:</span>

           <span class="text_search"><font color="#F9E031"><%=title%></font></span>  </b></td>

</tr>

<tr>
	<td background=images/pixelbgtable.gif class="textalb">
		<img src=images/arrow_white_tr.gif>
		<a
            onclick="javascript:theform.prj_jump.value='1';theform.submit();"
            style="cursor:hand;"
            class="textalb"><trans:showPageMessage label="md.identif" /></a>
	</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='1';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.plan" /></a>
</td>
</tr>

<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='2';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.loc" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='2';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.sec" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='2';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.comp" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='3';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.fin" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='3';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.prel" /></a>
</td>
</tr>

<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='4';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.cauth" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='5';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.ben" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='5';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.descobj" /></a>
</td>
</tr>

<tr>

          <td bgcolor="#336699" class="textalb"> <img src=images/arrow_white_tr.gif> <a href="editActivity?key=<%=key%>&page=6" class="textalb"><trans:showPageMessage label="md.docl" /></a>

          </td>

</tr>

<tr>

          <td bgcolor="#336699" class="textalb"> <img src=images/arrow_white_tr.gif> <a href="editActivity?key=<%=key%>&page=6" class="textalb"><trans:showPageMessage label="md.pinv" /></a>

          </td>

</tr>
<% if (aoo.isEnabled(ActObjsOptsConst.NOTEFIELDS)) { %>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='7';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="p.notefields" /></a>
</td>
</tr>
<% } %>

<tr>

          <td background=images/pixelbgtable.gif align="center">

            <input type="button" name="Help" class="buton" value="<trans:showPageMessage label="p.help" hide_link="true" />"

          onClick="javascript:help('aboutPage6.htm');">

          </td>

</tr>

<tr>

<td background=images/pixelbgtable.gif height="45">

<div align="center">

<input	type="button" onclick="javascript:document.theform.action.value='<%=EditActivityServlet.ACTION_SUBMIT%>';document.theform.preview_data.value='true';document.theform.submit();"

	value='<trans:showPageMessage label="p.pubinfo" hide_link="true" />'

	class="butonpublish"

/>
<trans:showPageMessage label="translator.showhiddentags"/>
</div>

</td>

</tr>

</table>

<!-- ziendof meniu dreapta -->

      </td>

    </tr>

  </table>

</form>



<script language="javascript">

function chlang(dd) {

if(dd.options[dd.selectedIndex].value == 'ro') window.location='/editActivity?lang=ro';

if(dd.options[dd.selectedIndex].value == 'us') window.location='/editActivity?lang=us';

}

</script>

<jsp:include page="footer.jsp" />

</body>
 <HEAD>
 <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
 </HEAD>
</html>

<!--

-->

